home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / networke / xfirepow.000 / xfirepow / xfirepower-0.84 / client / libsprite / fill.c < prev    next >
C/C++ Source or Header  |  1995-06-14  |  1KB  |  40 lines

  1. #include "allincludes.h"
  2.  
  3. void
  4. W_FillArea(window, x, y, width, height, color)
  5.     W_Window window;
  6.     int     x, y;
  7.     unsigned int width, height;
  8.     W_Color color;
  9. {
  10.     struct window *win;
  11.  
  12. #ifdef DEBUG
  13.     printf("Clearing (%d %d) x (%d %d) with %d on %d\n", x, y, width, height,
  14.        color, window);
  15. #endif
  16.     win = W_Void2Window(window);
  17.     switch (win->type) {
  18.     case WIN_GRAPH:
  19.     XFillRectangle(W_Display, win->drawable, colortable[color].contexts[0],
  20.                x, y, width, height);
  21.     break;
  22.     default:
  23.     XFillRectangle(W_Display, win->drawable, colortable[color].contexts[0],
  24.             WIN_EDGE + x * W_Textwidth, MENU_PAD + y * W_Textheight,
  25.                width * W_Textwidth, height * W_Textheight);
  26.     }
  27. }
  28.  
  29. W_DrawPolygon(window, points, npoints, color)
  30.      W_Window window;
  31.      W_Point *points;
  32.      int npoints;
  33.      W_Color color;
  34. {
  35.     struct window *win=W_Void2Window(window);
  36.  
  37.     XFillPolygon(W_Display, win->drawable, colortable[color].contexts[0],
  38.          (XPoint *)points, npoints, Convex, CoordModeOrigin);
  39. }
  40.